🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / settings / src / androidMain / kotlin / org / meshtastic / feature / settings / radio / component / SecurityConfigScreen.android.kt
Displaying Raw • Download
feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/radio/component/SecurityConfigScreen.android.kt 97ec245a70ef792e54a9e21a2d79c4832ced1d25 (97ec245a) Text, 3.61 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.settings.radio.component
Tff7b72import T7ee787android.app.Activity
Tff7b72import T7ee787android.content.Intent
Tff7b72import T7ee787androidx.activity.compose.rememberLauncherForActivityResult
Tff7b72import T7ee787androidx.activity.result.contract.ActivityResultContracts
Tff7b72import T7ee787androidx.compose.foundation.layout.padding
Tff7b72import T7ee787androidx.compose.material3.HorizontalDivider
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.compose.runtime.mutableStateOf
Tff7b72import T7ee787androidx.compose.runtime.saveable.rememberSaveable
Tff7b72import T7ee787androidx.compose.runtime.setValue
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787com.eygraber.uri.toKmpUri
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.common.util.nowMillis
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.export_keys
Tff7b72import T7ee787org.meshtastic.core.resources.export_keys_confirmation
Tff7b72import T7ee787org.meshtastic.core.ui.component.MeshtasticResourceDialog
Tff7b72import T7ee787org.meshtastic.core.ui.icon.MeshtasticIcons
Tff7b72import T7ee787org.meshtastic.core.ui.icon.Warning
Tff7b72import T7ee787org.meshtastic.feature.settings.radio.RadioConfigViewModel
Tff7b72import T7ee787org.meshtastic.proto.Config
Tf0883e@Composable
Tff7b72actual Tff7b72fun Td2a8ffExportSecurityConfigButtonTb4b4b4(
Te6edf3viewModelTb4b4b4: Te6edf3RadioConfigViewModelTb4b4b4,
Te6edf3enabledTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3securityConfigTb4b4b4: Te6edf3ConfigTb4b4b4.Te6edf3SecurityConfigTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3node Tff7b72by Te6edf3viewModelTb4b4b4.Te6edf3destNodeTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Tff7b72var Te6edf3showEditSecurityConfigDialog Tff7b72by Te6edf3rememberSaveable Tb4b4b4{ Te6edf3mutableStateOfTb4b4b4(Tff7b72falseTb4b4b4) Tb4b4b4}
Tff7b72val Te6edf3exportConfigLauncher Tff7b72=
Te6edf3rememberLauncherForActivityResultTb4b4b4(Te6edf3ActivityResultContractsTb4b4b4.Te6edf3StartActivityForResultTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Tffa657itTb4b4b4.Te6edf3resultCode Tff7b72=Tff7b72= Te6edf3ActivityTb4b4b4.Te6edf3RESULT_OKTb4b4b4) Tb4b4b4{
Tffa657itTb4b4b4.Te6edf3dataTff7b72?.Te6edf3dataTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3uri Tff7b72-Tff7b72> Te6edf3viewModelTb4b4b4.Te6edf3exportSecurityConfigTb4b4b4(Te6edf3uriTb4b4b4.Te6edf3toKmpUriTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3securityConfigTb4b4b4) Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tff7b72if Tb4b4b4(Te6edf3showEditSecurityConfigDialogTb4b4b4) Tb4b4b4{
Te6edf3MeshtasticResourceDialogTb4b4b4(
Te6edf3titleRes Tff7b72= Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3export_keysTb4b4b4,
Te6edf3messageRes Tff7b72= Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3export_keys_confirmationTb4b4b4,
Te6edf3onDismiss Tff7b72= Tb4b4b4{ Te6edf3showEditSecurityConfigDialog Tff7b72= Tff7b72false Tb4b4b4}Tb4b4b4,
Te6edf3onConfirm Tff7b72= Tb4b4b4{
Te6edf3showEditSecurityConfigDialog Tff7b72= Tff7b72false
Tff7b72val Te6edf3intent Tff7b72=
Te6edf3IntentTb4b4b4(Te6edf3IntentTb4b4b4.Te6edf3ACTION_CREATE_DOCUMENTTb4b4b4)Tb4b4b4.Te6edf3apply Tb4b4b4{
Te6edf3addCategoryTb4b4b4(Te6edf3IntentTb4b4b4.Te6edf3CATEGORY_OPENABLETb4b4b4)
Te6edf3type Tff7b72= Ta5d6ff"Ta5d6ffapplication/*Ta5d6ff"
Te6edf3putExtraTb4b4b4(Te6edf3IntentTb4b4b4.Te6edf3EXTRA_TITLETb4b4b4, Ta5d6ff"Tffd700${Te6edf3nodeTff7b72?.Te6edf3userTff7b72?.Te6edf3short_nameTffd700}Ta5d6ff_keys_Tffd700$Te6edf3nowMillisTa5d6ff.jsonTa5d6ff"Tb4b4b4)
Tb4b4b4}
Te6edf3exportConfigLauncherTb4b4b4.Te6edf3launchTb4b4b4(Te6edf3intentTb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Te6edf3HorizontalDividerTb4b4b4(Tb4b4b4)
Te6edf3NodeActionButtonTb4b4b4(
Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3paddingTb4b4b4(Te6edf3horizontal Tff7b72= T79c0ff8.Te6edf3dpTb4b4b4)Tb4b4b4,
Te6edf3title Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3export_keysTb4b4b4)Tb4b4b4,
Te6edf3enabled Tff7b72= Te6edf3enabledTb4b4b4,
Te6edf3icon Tff7b72= Te6edf3MeshtasticIconsTb4b4b4.Te6edf3WarningTb4b4b4,
Te6edf3onClick Tff7b72= Tb4b4b4{ Te6edf3showEditSecurityConfigDialog Tff7b72= Tff7b72true Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.06s